home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / X11 / Xaw / List.h < prev    next >
C/C++ Source or Header  |  2006-04-12  |  7KB  |  238 lines

  1. /* $Xorg: List.h,v 1.4 2001/02/09 02:03:44 xorgcvs Exp $ */
  2.  
  3. /*
  4. Copyright 1989, 1994, 1998  The Open Group
  5.  
  6. Permission to use, copy, modify, distribute, and sell this software and its
  7. documentation for any purpose is hereby granted without fee, provided that
  8. the above copyright notice appear in all copies and that both that
  9. copyright notice and this permission notice appear in supporting
  10. documentation.
  11.  
  12. The above copyright notice and this permission notice shall be included in
  13. all copies or substantial portions of the Software.
  14.  
  15. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
  18. OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  19. AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  20. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  21.  
  22. Except as contained in this notice, the name of The Open Group shall not be
  23. used in advertising or otherwise to promote the sale, use or other dealings
  24. in this Software without prior written authorization from The Open Group.
  25. */
  26. /* $XFree86: xc/lib/Xaw/List.h,v 1.7 2001/01/17 19:42:27 dawes Exp $ */
  27.  
  28. /*  This is the List widget, it is useful to display a list, without the
  29.  *  overhead of having a widget for each item in the list.  It allows 
  30.  *  the user to select an item in a list and notifies the application through
  31.  *  a callback function.
  32.  *
  33.  *    Created:     8/13/88
  34.  *    By:        Chris D. Peterson
  35.  *                      MIT X Consortium
  36.  */
  37.  
  38. #ifndef _XawList_h
  39. #define _XawList_h
  40.  
  41. #include <X11/Xaw/Simple.h>
  42.  
  43. /* Resources:
  44.  
  45.  Name             Class        RepType        Default Value
  46.  ----             -----        -------        -------------
  47.  background         Background        Pixel        XtDefaultBackground
  48.  borderColor         BorderColor    Pixel        XtDefaultForeground
  49.  borderWidth         BorderWidth    Dimension    1
  50.  callback            Callback           XtCallbackList  NULL       **6
  51.  columnSpacing       Spacing            Dimension       6
  52.  cursor             Cursor        Cursor        left_ptr
  53.  cursorName         Cursor        String        NULL
  54.  defaultColumns      Columns            int             2          **5
  55.  destroyCallback     Callback        Pointer        NULL 
  56.  font             Font        XFontStruct*    XtDefaultFont
  57.  forceColumns        Columns            Boolean         False      **5
  58.  foreground         Foreground        Pixel        XtDefaultForeground
  59.  height             Height        Dimension    0          **1
  60.  insensitiveBorder   Insensitive    Pixmap        Gray
  61.  internalHeight         Height        Dimension    2
  62.  internalWidth         Width        Dimension    4
  63.  list             List        String*        NULL       **2
  64.  longest             Longest            int             0          **3  **4
  65.  mappedWhenManaged   MappedWhenManaged    Boolean        True
  66.  numberStrings       NumberStrings      int             0          **4
  67.  pasteBuffer         Boolean            Boolean         False
  68.  pointerColor         Foreground        Pixel        XtDefaultForeground
  69.  pointerColorBackground Background    Pixel        XtDefaultBackground
  70.  rowSpacing          Spacing            Dimension       4
  71.  sensitive         Sensitive        Boolean        True
  72.  verticalList        Boolean            Boolean         False
  73.  width             Width        Dimension    0          **1
  74.  x             Position        Position    0
  75.  y             Position        Position    0
  76.  
  77.  **1 - If the Width or Height of the list widget is zero (0) then the value
  78.        is set to the minimum size necessay to fit the entire list.
  79.  
  80.        If both Width and Height are zero then they are adjusted to fit the
  81.        entire list that is created width the number of default columns 
  82.        specified in the defaultColumns resource.
  83.  
  84.  **2 - This is an array of strings the specify elements of the list.
  85.        This resource must be specified. 
  86.        (What good is a list widget without a list??  :-)
  87.  
  88.  **3 - Longest is the length of the widest string in pixels.
  89.  
  90.  **4 - If either of these values are zero (0) then the list widget calculates
  91.        the correct value. 
  92.  
  93.        (This allows you to make startup faster if you already have 
  94.         this information calculated)
  95.  
  96.        NOTE: If the numberStrings value is zero the list must 
  97.              be NULL terminated.
  98.  
  99.  **5 - By setting the List.Columns resource you can force the application to
  100.        have a given number of columns.         
  101.         
  102.  **6 - This returns the name and index of the item selected in an 
  103.        XawListReturnStruct that is pointed to by the client_data
  104.        in the CallbackProc.
  105.  
  106. */
  107.  
  108. /*
  109.  * Value returned when there are no highlighted objects
  110.  */
  111. #define XAW_LIST_NONE -1    
  112.  
  113. #define XtCList "List"
  114. #define XtCSpacing "Spacing"
  115. #define XtCColumns "Columns"
  116. #define XtCLongest "Longest"
  117. #define XtCNumberStrings "NumberStrings"
  118.  
  119. #define XtNcursor "cursor"
  120. #define XtNcolumnSpacing "columnSpacing"
  121. #define XtNdefaultColumns "defaultColumns"
  122. #define XtNforceColumns "forceColumns"
  123. #define XtNlist "list"
  124. #define XtNlongest "longest"
  125. #define XtNnumberStrings "numberStrings"
  126. #define XtNpasteBuffer "pasteBuffer"
  127. #define XtNrowSpacing "rowSpacing"
  128. #define XtNverticalList "verticalList"
  129. #define XtNshowCurrent "showCurrent"
  130.  
  131. #ifndef XtNfontSet
  132. #define XtNfontSet "fontSet"
  133. #endif
  134.  
  135. #ifndef XtCFontSet
  136. #define XtCFontSet "FontSet"
  137. #endif
  138.  
  139. extern WidgetClass listWidgetClass;
  140.  
  141. typedef struct _ListClassRec *ListWidgetClass;
  142. typedef struct _ListRec      *ListWidget;
  143.  
  144. /* list return structure */
  145. typedef struct _XawListReturnStruct {
  146.   String string;
  147.   int list_index;
  148. } XawListReturnStruct;
  149.  
  150. _XFUNCPROTOBEGIN
  151.  
  152. /*
  153.  * Function:
  154.  *    XawListChange
  155.  *
  156.  * Parameters:
  157.  *    w    - list widget
  158.  *    list    - new list
  159.  *    nitems    - number of items in the list
  160.  *    longest - length (in Pixels) of the longest element in the list
  161.  *    resize    - if True the the list widget will try to resize itself
  162.  *
  163.  * Description:
  164.  *    Changes the list being used and shown.
  165.  *
  166.  * Note:
  167.  *    If nitems of longest are <= 0 then they will be caluculated
  168.  *    If nitems is <= 0 then the list needs to be NULL terminated
  169.  */
  170. void XawListChange
  171. (
  172.  Widget            w,
  173.  String            *list,
  174.  int            nitems,
  175.  int            longest,
  176. #if NeedWidePrototypes
  177.  int            resize
  178. #else
  179.  Boolean        resize
  180. #endif
  181.  );
  182.  
  183. /*
  184.  * Function:
  185.  *    XawListUnhighlight
  186.  *
  187.  * Parameters:
  188.  *    w - list widget
  189.  *
  190.  * Description:
  191.  *    Unlights the current highlighted element.
  192.  */
  193. void XawListUnhighlight
  194. (
  195.  Widget            w
  196.  );
  197.  
  198. /*
  199.  * Function:
  200.  *    XawListHighlight
  201.  *
  202.  * Parameters:
  203.  *    w    - list widget
  204.  *    item - item to highlight
  205.  *
  206.  * Description:
  207.  *    Highlights the given item.
  208.  */
  209. void XawListHighlight
  210. (
  211.  Widget            w,
  212.  int            item
  213.  );
  214.  
  215.  
  216. /*
  217.  * Function:
  218.  *    XawListShowCurrent
  219.  *
  220.  * Paraneters:
  221.  *    w - list widget
  222.  *
  223.  * Description:
  224.  *    Returns the currently highlighted object.
  225.  *
  226.  * Returns:
  227.  *    The info about the currently highlighted object
  228.  */
  229.  
  230. XawListReturnStruct *XawListShowCurrent
  231. (
  232.  Widget            w
  233.  );
  234.  
  235. _XFUNCPROTOEND
  236.  
  237. #endif /* _XawList_h */
  238.